import request from '@/utils/request'

// 测试接口
export function helloApi() {
  return request({
    url: '/cinema/apiTest/hello',
    method: 'get',
  })
}

// 查询所有影院
export function queryAllCinema() {
  return request({
    url: '/cinema/queryAllCinema',
    method: 'get',
  })
}

// 根据条件查询影院
export function queryCinemaByCondition(params) {
  return request({
    url: '/cinema/queryCinemaByCondition',
    method: 'get',
    params
  })
}

// 分页查询影院
export function queryCinemaByPage(params) {
  return request({
    url: '/cinema/queryCinemaByPage',
    method: 'get',
    params
  })
}

// 新增影院
/* export function addCinema(params) {
  return request({
    url: '/cinema/addCinema',
    method: 'post',
    data: params
  })
} */
  export function addCinema(data) {
    return request({
      url: '/cinema/addCinema',
      method: 'post',
      data: data
    })
  }

// 修改影院
export function updateCinema(data) {
  return request({
    url: '/cinema/updateCinema',
    method: 'put',
    data
  })
}

// 删除影院
export function deleteCinema(cinemaId) {
  return request({
    url: '/cinema/deleteCinema/' + cinemaId,
    method: 'delete'
  })
}
